import 'package:flutter/material.dart';

class nearInfo extends StatefulWidget{
  @override
  _nearInfoState createState()=>_nearInfoState();

}
class _nearInfoState extends State<nearInfo> with AutomaticKeepAliveClientMixin
{
 int count=0;
 void add(){
   setState((){
     count++;
   });
 }
 @override
  Widget build(BuildContext context) {
    // TODO: implement build
    return Scaffold(
      body: Center(
        child: Text('near:$count',style: TextStyle(fontSize: 30)),
      ),
      floatingActionButton: FloatingActionButton(
        onPressed: add,
        child: Icon(Icons.add),
      ),
    );
  }

  @override
  void initState() {
    // TODO: implement initState
    super.initState();
    print('near initState');
  }
  @override
  // TODO: implement wantKeepAlive
  bool get wantKeepAlive => true;
}